CC = gcc
LD = gcc

SRCS = SDL_Jeu.c SDL_Joueur.c SDL_menu.c SDL_rotozoom.c carte.c case.c grpmonstre.c grpobjet.c grptir.c jeu.c main.c objet.c perso.c pile.c terrain.c tir.c NCU_Jeu.c

FINAL_TARGET = ur2e

 

LIBS = -lSDL -lm -lSDL_image -lncurses



LDFLAGS =

DEFINE = -DLINUX -DJEU_SDL 

CFLAGS = $(DEFINE) -Wall 

OBJ_DIR = bin

INCLUDE_DIR = -I/usr/include -Isrc -I/usr/include/SDL

SRC_DIR = src

BIN_DIR = bin

default: $(BIN_DIR)/$(FINAL_TARGET)

$(BIN_DIR)/$(FINAL_TARGET): $(SRCS:%.c=$(OBJ_DIR)/%.o)
	$(LD) $+ -o $@ $(LDFLAGS) $(LIBS)

$(OBJ_DIR)/main.o: $(SRC_DIR)/main.c 
	$(CC) -c $(CFLAGS) $(INCLUDE_DIR) $< -o $@

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(SRC_DIR)/%.h
	$(CC) -c $(CFLAGS) $(INCLUDE_DIR) $< -o $@ 

clean:
	rm -f $(OBJ_DIR)/*.o $(BIN_DIR)/$(FINAL_TARGET)

